(function($){
	    $.fn.typecombotree = function(param){
		    var th = this;
		    //复制用户自定义属性
	        param = $.extend({},$.fn.typecombotree.defaults,param);
	        $(th).combotree(param);
	        //console.log(param.multiple);
	        if(!param.noClear){
	        	var div = $(th).combotree('panel');
	        	div.css('position','relative');
	        	var a = $('<a href="javascript:void(0);" style="position:absolute;right:3px;top:1px;color:blue;">清空</a>').appendTo(div);
	        	a.click(function(){
	        		$(th).combotree('setValue','');
	        	});
	        	
	        }
	    };
    $.fn.typecombotree.defaults = {
	    url:'/sczh2/gt/emerg/user//EmergUser_searchJsonTree.action',
	    params:{},
	    valueField:'id',
        textField:'text',
        panelWidth:240,
        checkbox:false,
	   	onClick:function (node){
			    $(this).tree('expand',node.target);
	    },
	    onExpand:function(node){},
	    //加载数据失败的处理        
	    onLoadError: function () {    
               top.showTip({content:'类型树加载失败，请稍后再试！'}); 
           },
        onLoadSuccess:function(node, data){
               $(".sel-all").remove();
        }     
	};
})(jQuery);